<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('labourer_wages', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('labourer_id');
            $table->unsignedBigInteger('project_id')->index();
            $table->string('period')->nullable()->comment('发放周期');
            $table->decimal('pay',10,2)->default(0)->comment('应发工资');
            $table->decimal('deductions',10,2)->default(0)->comment('扣除项');
            $table->decimal('price',10,2)->default(0)->comment('实发工资');
            $table->tinyInteger('status')->default(0)->comment('发放状态');
            $table->string('method')->nullable()->comment('支付方式');
            $table->date('payment_date')->comment('发放日期');
            $table->string('files')->nullable()->comment('发放凭证');
            $table->string('issue_date')->nullable()->comment('发放月份');
            $table->string('remarks')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('labourer_wages');
    }
};
